<template>
	<view>
		<navbar class="dfcs" :backshow="true" :title="title" :navBarHeight="navBarHeight" :menuRight="menuRight"
			:menuTop="menuTop" :menuHeight="menuHeight"></navbar>
		<!-- tab切换 -->
		<!-- 头部展位 -->
		<view class="main mainsss " :style="{ height: mainheight + 'px' }"></view>
		<!--  -->
		<view class="creditbox">
			<view class="creditboxtile">
				您的信用分值
			</view>
			<view class="creditboxfz">
				{{userce}} <span>分</span>
			</view>
		</view>
		<view class="creditboxmain">
			<view class="creadicon">
				<span>信用分值变化</span>
				<image src="@/static/xyfbj.png" mode=""></image>
			</view>
			<view class="creadminmain">
				<view class="creaditem" v-for="item in credata" :key="item.index">
					<view class="creaditemec">
						<view class="creaditemname" v-if="item.score !=null">
							{{item.appointment}}
						</view>
						<view class="creaditemname" v-if="item.score ==null">
							恢复满分
						</view>
						<view class="creaditemdes">
							{{item.cause}}
						</view>
					</view>

					<view class="creaditemage" v-if="item.score !=null">
						-{{item.score}}分
					</view>
					<view class="creaditemage" v-if="item.score ==null">
						+100分
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: "信用分值",
				navBarHeight: 0, // 导航栏高度
				menuRight: 10, // 胶囊距右方间距（方保持左、右间距一致）
				menuTop: 50, // 胶囊距底部间距（保持底部间距一致）
				menuHeight: 0, // 胶囊高度（自定义内容可与胶囊高度保证一致）
				mainheight: 60,
				credata: [],
				userce: ''

			}
		},
		onLoad() {
			this.pageNum = 1;
			const that = this;
			// 获取系统信息
			const systemInfo = wx.getSystemInfoSync();
			// 胶囊按钮位置信息
			const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
			// 导航栏高度 = 状态栏高度 + 44
			that.navBarHeight = systemInfo.statusBarHeight + 44;
			that.menuRight = systemInfo.screenWidth - menuButtonInfo.right;
			that.menuTop = menuButtonInfo.top;
			that.menuHeight = menuButtonInfo.height;
			that.mainheight = menuButtonInfo.top + menuButtonInfo.height;

			this.$myRequest({
				url: '/client/appointmentUser/creditList',

			}).then((res) => {
				console.log('获取信用分记录', res.data);
				this.credata = res.data

			})
			this.$myRequest({
				url: '/client/appointmentUser/userInfo',

			}).then((res) => {
				console.log('获取个人信用分', res.data);

				this.userce = res.data.userCredit
			})
		},
		methods: {

		}
	}
</script>

<style>
	page {
		background: linear-gradient(180deg, #0072FF 0%, #00F6FF 100%);

	}

	.dfcs .nav-bar {

		background: none;

	}

	.dfcs .nav-bar .search {
		background: none;
		color: #ffffff !important;
	}

	.dfcs .titlebox {
		color: #ffffff !important;
	}

	.dfcs .uni-icons {
		color: #ffffff !important;
	}
</style>